<!--
 * @Descripttion: 
 * @Author: voanit
 * @Date: 2022-08-29 16:32:37
 * @LastEditors: voanit
 * @LastEditTime: 2022-08-29 16:47:26
-->

<template>
  <div>
    御剑乘风来,除魔天地间!===vue3==={{ num }}==={{ obj.n }}
    <button @click="handle">按钮</button>
  </div>
</template>
<script>
import { reactive } from 'vue'
export default {
  name: '',
  setup () {
    /* 
    reactive:将普通对象转换成响应式对象
    */
    let num = 10
    const obj = reactive({
      n: 1
    })
    // console.log(this, 999);
    const handle = () => {
      obj.n += 1
      console.log(obj.n);
    }
    return { num, handle, obj }
  }
}
</script>
<style lang='less'  scoped>
</style>